﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShenJingLX.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS._2.YongHuGL.ShenJingLX" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>深井类型修改</title>
      <script src="../../../../JS/jquery.js"></script>
      <script src="../../../../JS/AddEditCancel.js"></script>
        <script type="text/javascript">
            function ExsistNo() {
                //1.$.ajax带json数据的异步请求
                if (txtNo.GetText() != "") {
                    var aj = $.ajax({
                        url: '../../../../ashx/QS_YH.ashx',// 跳转到 action  
                        data: {
                            MethodName: 'GetInfo',//所要调用的方法名称
                            No: txtNo.GetText()
                        },
                        type: 'post',
                        cache: false,
                        dataType: 'json',
                        success: function (data) {
                            if (data.Is_Success == 1) {
                                txtOldNo.SetText(data.OldNo);
                                cmJingLei.SetValue(data.WellType);
                            } else {
                                txtOldNo.SetText(data.OldNo);
                                cmJingLei.SetValue(data.WellType);
                                alert(data.Message);

                            }
                        },
                        error: function () {
                            alert("系统繁忙,请稍后再试！");
                        }
                    });
                }
            };
            function save() {
                if (txtNo.GetText() == "") {
                    alert("请输入井编号！");
                    txtNo.Focus();
                    return;
                }
                if (txtLetterNo.GetText() == "") {
                    alert("请输入来函号！");
                    txtLetterNo.Focus();
                    return;
                }
                if (cmJingLei.GetText() == "") {
                    alert("请选择井类！");
                    txtLetterNo.Focus();
                    return;
                }
                if (deChangeDate.GetText() == "") {
                    alert("请选择变更日期！");
                    deChangeDate.Focus();
                    return;
                }
                ASPxCallback1.PerformCallback("save");
            }
            function cancel()
            {
                txtNo.SetText();
                txtOldNo.SetText();
                txtLetterNo.SetText();
                cmJingLei.SetValue();
            };

            function ASPxCallback1Complete(rs) {
                var arr = rs.split('|');
                var type = arr[0];
                var state = arr[1];
                var specialIdentity = arr[2];
                var msg = arr[3].split('-');
                if (msg[0] == 'True') {
                    alert(msg[1]);
                }
               
            }
        </script>
    <style>
        #Info {
            height: 250px;
            width: 400px;
        }
        .tr-style {
             height: 40px;
        }
        .td-1 {
            width:15%;
        }
        .td-2 {
            width:85%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
      <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <div class="tabletitle1" align="center">
            深井类型修改
        </div>
        <fieldset style="border: 1px solid #a3c0e8;">
            <legend>修改信息</legend>
            <div style="height: 300px;" align="center">
                <table id="Info">
                    <tr class="tr-style">
                        <td colspan="2">当前水量年月：<%=Year%>年<%=Month%>月</td>
                    
                    </tr>
                    <tr class="tr-style">
                        <td class="td-1">井编号：</td>
                        <td class="td-2">
                            <dx:ASPxTextBox ID="txtNo" ClientInstanceName="txtNo" runat="server" MaxLength="7" Width="100" >
                                <ClientSideEvents  LostFocus="function(s,e){ExsistNo();}"   />
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr class="tr-style">
                        <td class="td-1">原井号：</td>
                        <td class="td-2">
                            <dx:ASPxTextBox ID="txtOldNo" ClientInstanceName="txtOldNo" runat="server" MaxLength="30" Width="250"  ClientEnabled="false">
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr class="tr-style">
                        <td class="td-1">来函号：</td>
                        <td class="td-2">
                            <dx:ASPxTextBox ID="txtLetterNo" ClientInstanceName="txtLetterNo" runat="server" MaxLength="11" Width="250">
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr class="tr-style">
                        <td class="td-1">井类：</td>
                        <td class="td-2">
                            <dx:ASPxComboBox ID="cmJingLei" ClientInstanceName="cmJingLei" runat="server" Width="50%" ValueType="System.String">
                            </dx:ASPxComboBox>
                        </td>
                    </tr>
                    <tr class="tr-style">
                        <td class="td-1"><span style="font-size: 12px;">变更日期：</span></td>
                        <td class="td-2">
                            <dx:ASPxDateEdit ID="deChangeDate" runat="server">
                                <CalendarProperties ClearButtonText="清除" TodayButtonText="今天"></CalendarProperties>
                            </dx:ASPxDateEdit>
                        </td>
                    </tr>
                </table>

            </div>
        </fieldset>
        <div align="right">
            <table id="GridViewButtonTable" runat="server">
                <tr>
                    <td style="text-align: center;">
                        <dx:ASPxButton ID="btnChange" ClientInstanceName="btnSave" runat="server" Text="井类修改" AutoPostBack="false" UseSubmitBehavior="false" ClientSideEvents-Click="function(s,e){save();}">
                        </dx:ASPxButton>
                        <dx:ASPxButton ID="btnCancel" runat="server" Text="取消" AutoPostBack="false" ClientSideEvents-Click="function(s,e){cancel();}" UseSubmitBehavior="false">
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
